<script setup>
import { ref, computed } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const activeMenu = computed(() => route.path)
</script>

<template>
  <div class="app-container">
    <el-container>
      <el-header>
        <div class="header-content">
          <h1>网站压力测试工具</h1>
          <el-menu
            mode="horizontal"
            :router="true"
            :default-active="activeMenu"
          >
            <el-menu-item index="/">压力测试</el-menu-item>
            <el-menu-item index="/history">历史记录</el-menu-item>
          </el-menu>
        </div>
      </el-header>
      
      <el-main>
        <router-view></router-view>
      </el-main>
      
      <el-footer>
        <div class="footer-content">
          <p>© 2024 网站压力测试工具. All rights reserved.</p>
        </div>
      </el-footer>
    </el-container>
  </div>
</template>

<style>
.app-container {
  min-height: 100vh;
}

.el-container {
  min-height: 100vh;
}

.el-header {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-content h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #409EFF;
}

.el-main {
  background-color: #f5f7fa;
  padding: 20px;
}

.el-footer {
  background-color: #fff;
  padding: 20px 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: #909399;
}

.el-menu {
  border-bottom: none;
}

.el-menu--horizontal > .el-menu-item {
  height: 60px;
  line-height: 60px;
}
</style>
